package com.njtoyo.taxi.admin.handler;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import lombok.Data;

import java.util.Date;

@Data
public class DateTimeHandler {

    private Date today;
    private Date todayBeginning;
    private Date yesterdayBeginning;
    private Date yesterdayEnd;
    private Date yesterdaySameTime;
    private Date lastWeekBeginning;
    private Date lastWeekSameTime;

    public DateTimeHandler() {
        this.today = new DateTime();
        this.todayBeginning = DateUtil.beginOfDay(today);
        this.yesterdayBeginning = DateUtil.beginOfDay(DateUtil.yesterday());
        this.yesterdayEnd = DateUtil.endOfDay(DateUtil.yesterday());
        this.yesterdaySameTime = DateUtil.yesterday();
        this.lastWeekBeginning = DateUtil.beginOfDay(DateUtil.lastWeek());
        this.lastWeekSameTime = DateUtil.lastWeek();
    }
}
